home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 4 #10
/
Commodore_Disk_User_Vol.4_10_1991_-.d64
/
lite demo
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
5KB
|
158 lines
10 rem ************************
20 rem * lite menus! o/s demo *
30 rem * created by *
40 rem * madhu surendranath *
50 rem * (c) copyright jan 91 *
60 rem ************************
70 poke 53280,0:poke53281,0:poke646,15:poke53272,23:printchr$(8)
80 print"[147][215]elcome to the [204][201][212][197] [205][197][206][213][211]! [146] demo"
100 print"[194]y [205]adhu [211]urendranath."
110 print"[204][201][212][197] [205][197][206][213][211]! will transform your way"
120 print"of creating menus. [201]nstead of writing"
130 print"complex routines in [205]/[195] to get"
140 print"highlight bars, this routine will do"
150 print"that job for you, and it is written in"
160 print"[194][193][211][201][195]!!"
170 print"[193]ll you have to do is setup a few"
180 print"parameters and a list of the subject"
190 print"headings."
200 gosub 990
210 print"[147][201]f your still not convicted that it "
220 print"could be so easy, watch this space "
230 print"[208][204][197][193][211][197][160][212][217][208][197][160][201][206] 5 [211][213][194][202][197][195][212][211]"
240 forj=1to5
250 print" (";j;")";:input o$(j):ifo$(j)=""then250
260 ln=len(o$(j)):ifln>len(o$(j-1))thendl=j
265 nextj
270 print"[208][204][197][193][211][197][160][212][217][208][197] [201][206][160][216] co-ord[160][198][207][210][160][212][200][197][160][204][201][211][212]"
280 print"x co-ord = ";:input x:ifx<1orx>30 then 280 :dx=x
290 print"[208][204][197][193][211][197][160][212][217][208][197][160][201][206][160][217] co-ord [198][207][210][160][212][200][197][160][204][201][211][212]"
300 print"y co-ord = ";:input y:ify<1ory>20 then 300 :dy=y
310 dx=x: dy=y:gosub 990
320 print"[147] [212]he list will be printed at:"
325 print"x=";x;" y=";y : x1=y
330 x=0:gosub12000:x=x1
340 for j=1 to 5
350 print tab(x);o$(j):
360 next j
365 gosub 990
370 print"[147][206]ow we have to put the bar in for the"
380 print"highlight. [206]ow we setup some variables."
390 print"[200]ere is a list of parameters :-"
400 print"[205][201][206] : [205]inimum number of the list"
410 print"[205][193][216] : [205]aximum number of the list"
420 print"[208][211] : [206]umber of lines from top of screen ([217] co-ord -1)"
430 print"[193] : [195]ontrol variable (set to 1)"
440 print"[212][193] : [206]umber of chars from left edge of the screen ([216] co-ord)"
450 print"and that is it."
460 print"[211]o in this case, the parameters are :-"
470 print"[205][201][206]=1:[205][193][216]=5:[208][211]=";(y-1);":[193]=1:[212][193]=";x;":"
480 print"[199][207][211][213][194]11000"
490 gosub990
500 print"[147][201]t is usually nice to surround the "
510 print"menu with a border."
520 print"[206]ow with [204][201][212][197]-[205][197][206][213][211]! no more looking"
530 print"for those graphic characters, just"
540 print"give x,y co-ords, x,y size length and"
550 print"a choice of one of the 3 surrounds."
560 print"[212]he surrounds are defined as :-"
570 print"[195][200]=1 : '[166]' hatched box"
580 print"[195][200]=2 : '[176]' square box"
590 print"[195][200]=3 : '(' circular box"
600 print"[217]ou can also change the colour if you"
610 print"wish."
620 gosub 990
630 print"[147][197]xample definition of a box."
640 print"[216]=10:[217]=8:[216]1=15:[217]1=8:[195][207][204]=4:[195][200]=1: [199][207][211][213][194]10000"
650 print"[206]ow you will see a box as defined...."
660 x=10:y=8:x1=15:y1=8:col=4:ch=1:gosub10000
670 print"[206]ext is a demo of random boxes of"
680 print"of random colours at random positions."
690 print"[212]o exit the next screen, press [211][208][193][195][197][146]"
700 gosub990
710 print"[147]":poke53272,21:printchr$(8):a=rnd(-ti)
720 x=int(rnd(1)*29)+1 : y=int(rnd(1)*13)+1
730 x1=int(rnd(1)*10)+1: y1=int(rnd(1)*10)+1:x1=x1+1:y1=y1+1
740 col=int(rnd(1)*15)+1 : ch=int(rnd(1)*3)+1
750 gosub10000
760 gets$:ifs$=" "then800
770 goto720
800 print"[147]":poke53272,23
810 print"[198]inal [211]ection - [204][201][212][197] [205][197][206][213][211]!"
820 print"[215]ith the five subject titles you "
830 print"typed in, [204][201][212][197][160][205][197][206][213][211]! will create a "
840 print"menu with a hi-light bar using the"
850 print"the techniques used during this demo."
860 print"[201] hope that this demo will help you "
870 print"create menus with the minimum of work."
880 print"[198]or further assistance, please read"
890 print"[195]ommodore [196]isk [213]ser."
900 gosub990:print"[147]":poke53272,21
905 print"[147]demo menu set up by you!! [146]"
907 print"[183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]"
908 print" crsr [146] (execute) return [146] (select)"
910 x=dx:y=dy:x1=len(o$(dl))+2:y1=7:col=3:ch=2:gosub10000
920 print""
930 x=x+1:y=y+1:gosub12000
940 forj=1to5:print tab(dx+1);o$(j):nextj
950 min=1:max=5:ps=y-1:a=1:ta=x:gosub11000
960 forj=1to1000:nextj:print"";:forj=1to998:print" [146][157][157] ";:nextj:print"[147]"
970 poke53272,23:printchr$(8);
972 print"[147][212]hank you for using this demo."
974 print"[208]lease feel free to add [204][201][212][197] [205][197][206][213][211]! to"
976 print"your own programs, but it would be"
978 print"nice to see an acknowledgement for "
980 print"using it in your own creations."
982 print"[204][201][212][197][160][205][197][206][213][211]! menu system created by"
984 print"[205]adhu [211]urendranath. [202]anuary 1991."
989 end
990 print" [208]ress < [211][208][193][195][197] > [212]o [195]ontinue [146]"
992 gets$:ifs$=""then992
993 ifs$=" "then return
994 goto 992
999 end
10000 rem *****************************
10010 rem * lite menus! o/s version 1 *
10020 rem * created by *
10030 rem * madhu surendranath (16) *
10040 rem * (c) copyright jan. 1991 *
10050 rem *****************************
10060 if ch=1 then c$(1)="[166]":c$(2)="[166]":c$(3)="[166]":c$(4)="[166]":c$(5)="[166]":c$(6)="[166]"
10070 if ch=2 then c$(1)="[176]":c$(2)="[195]":c$(3)="[174]":c$(4)="[194]":c$(5)="[173]":c$(6)="[189]"
10080 if ch=3 then c$(1)="[213]":c$(2)="[195]":c$(3)="[201]":c$(4)="[194]":c$(5)="[202]":c$(6)="[203]"
10090 oc=peek(646):poke 646,col
10100 poke 781,y:poke782,x:sys 65520
10110 print c$(1);:for a=1 to x1-2
10120 print c$(2);:next:print c$(3)
10130 for a=1 to y1-2
10140 print tab(x) c$(4) tab(x+x1-1) c$(4)
10150 next a
10160 print tab(x) c$(5);:for a=1 to x1-2
10170 print c$(2);:next:print c$(6)
10180 poke 646,oc
10190 return
11000 rem ** flash/menu **
11010 y=ps+a
11020 poke 781,y:poke 782,ta:sys65520
11030 poke 199,1:print o$(a);:poke199,0
11040 get a$:ifa$<>""anda$<>"[145]"anda$<>chr$(13)then11040
11050 ifa$=""then b=a:a=a+1:goto11080
11060 ifa$="[145]"then b=a:a=a-1:goto11100
11070 ifa$=chr$(13) then zz=y:goto11120
11080 ifb=max thena=min:poke781,y:poke782,ta:sys65520:printo$(b):b=min:goto11010
11090 ifb<>max then poke781,ps+b:poke782,ta:sys65520:printo$(b):goto11010
11100 ifb=min thena=max:poke781,y:poke782,ta:sys65520:printo$(b):b=max:goto11010
11110 ifb<>min then poke781,ps+b:poke782,ta:sys65520:printo$(b):goto11010
11120 y=zz:forl=1 to 4
11130 poke 646,11:gosub11180
11140 poke 646,12:gosub11180
11150 poke 646,15:gosub11180
11160 next l
11170 return
11180 print"":forg=1to(zz-1):print"";:nextg:printtab(ta);
11190 poke199,1:printo$(a):poke199,0:forq=1to10:nextq
11200 return
12000 rem * print at *
12010 poke 781,y:poke782,x:sys65520
12020 return